package com.macro.mall.demo.pattern.chain;

import com.macro.mall.demo.pattern.chain.service.FirstBusinessChain;
import com.macro.mall.demo.pattern.chain.service.SecondBusinessChain;
import com.macro.mall.demo.pattern.chain.service.ThirdBusinessChain;

public class Demo {

    public static void main(String[] args) {

        BusinessChainBuilder<String> objectBusinessChainBuilder = new BusinessChainBuilder<>();
        objectBusinessChainBuilder.first(new FirstBusinessChain());
        objectBusinessChainBuilder.next(new SecondBusinessChain());
        objectBusinessChainBuilder.next(new ThirdBusinessChain());
        BusinessChain<String> build = objectBusinessChainBuilder.build();
        build.process("zhangsan");

    }
}
